import { Schema, model, Types } from "mongoose";

export interface TagDoc {
  _id: Types.ObjectId;
  name: string;
  createdAt: Date;
  updatedAt: Date;
}

const TagSchema = new Schema<TagDoc>(
  {
    name: { type: String, required: true, unique: true, index: true },
  },
  { timestamps: true }
);

export const TagModel = model<TagDoc>("Tag", TagSchema);
